{template 'public/header'}
{template 'public/comhead'}
<style>
   .navback{width: 0}
    .main{margin: 16px 0px 30px 45px;}
    .nav_box{
        left: 150px;
        top: 48px;
        bottom: 0;
        color: #333;
        border-right: 1px solid #efefef;
        text-align: center;
        position: fixed;
        background: #fff;
        z-index: 99;   
        padding:0;     
    }
    .left_nav{
        padding-top: 20px
    }
    .left_nav li{
        line-height: 45px;
    }
    .left_nav li.active{
        color: #00aeff;
        background: #edf6ff
    }
    .left_nav li:hover{
        background: #edf6ff;
    }
    .left_nav li:hover a{
        color: #00aeff;
    }
</style>
<link rel="stylesheet" type="text/css" href="../addons/zh_cjdianc/template/public/ygcss.css">
<div class="nav_box col-md-1">
    <ul class="left_nav">
    <!--     <span class="ygxian"></span>
        <div class="ygdangq">当前位置:</div>  -->   
      <li><a href="{php echo $this->createWebUrl('incoupons')}">优惠券列表</a></li>
      <li class="active"><a href="{php echo $this->createWebUrl('inaddcoupons')}">添加/编辑优惠券</a></li>
    </ul>
</div>

<!-- <ul class="nav nav-tabs">
    <span class="ygxian"></span>
    <div class="ygdangq">当前位置:</div>
    <li><a href="{php echo $this->createWebUrl('incoupons')}">优惠券管理</a></li>
    <li class="active"><a href="{php echo $this->createWebUrl('inaddcoupons')}">添加/编辑优惠券</a></li>
</ul> -->
<div class="main">
    <form action="" method="post" class="form-horizontal form" enctype="multipart/form-data">
        <div class="panel panel-default ygdefault">
            <div class="panel-heading wyheader">
                添加/编辑优惠券
            </div>
        <div class="panel-body">
                <form class="form-horizontal" action="" method="POST">
  <div class="form-group">
    <label for="inputEmail3" class="col-sm-2 control-label">优惠券名称</label>
    <div class="col-sm-10">
      <input type="text"  name="name" value="{$list['name']}" class="form-control" id="inputEmail3" placeholder="请填写优惠券名称">
    </div>
  </div>
   <div class="form-group">
    <label for="inputEmail3" class="col-sm-2 control-label">优惠条件金额</label>
    <div class="col-sm-5">
      <div class="input-group">
          <input type="text" onkeyup="value=value.replace(/[^\d.]/g,'')"  name="full" value="{$list['full']}" class="form-control" id="inputEmail3" placeholder="请填写优惠条件金额">
          <span class="input-group-addon">元</span>
      </div>
    </div>
  </div>
<div class="form-group">
    <label for="inputEmail3" class="col-sm-2 control-label">优惠金额</label>
    <div class="col-sm-5">
      <div class="input-group">
        <input type="text" onkeyup="value=value.replace(/[^\d.]/g,'')"  name="reduce" value="{$list['reduce']}" class="form-control" id="inputEmail3" placeholder="请填写优惠金额">
        <span class="input-group-addon">元</span>
      </div>
    </div>
  </div>
  <div class="form-group">
    <label for="inputEmail3" class="col-sm-2 control-label">优惠券数量</label>
    <div class="col-sm-10">
      <input type="number"  name="number" value="{$list['number']}" class="form-control" id="inputEmail3" placeholder="请填写优惠券数量">
    </div>
  </div>
  {if $list['id']}
  <div class="form-group">
    <label for="inputEmail3" class="col-sm-2 control-label">优惠券剩余数量</label>
    <div class="col-sm-10">
      <input type="number"  name="stock" value="{$list['stock']}" class="form-control" id="inputEmail3" placeholder="请填写优惠券剩余数量">
    </div>
  </div>
  {/if}
<div class="form-group">
    <label for="inputEmail3" class="col-sm-2 control-label">优惠券时间</label>
    <div class="col-sm-10">
    {php echo tpl_form_field_daterange('time',array('start' =>$list['start_time'], 'end' =>$list['end_time']));} 
    </div>
  </div>

    <div class="form-group">
      <label for="inputEmail3" class="col-sm-2 control-label">设置使用范围</label>
      <div class="col-sm-10">
        <select class="form-control" name="type"> 
          {if $list['type']==1}  
            <option value="1" selected="selected">仅限外卖使用</option>  
            <option value="2">仅限店内使用</option>
            <option value="3">两者都可使用</option>
          {elseif $list['type']==2}
            <option value="1" >仅限外卖使用</option>    
            <option value="2" selected="selected">仅限店内使用</option>
            <option value="3">两者都可使用</option>
          {elseif $list['type']==3}
            <option value="1" >仅限外卖使用</option>  
            <option value="2">仅限店内使用</option>
            <option value="3" selected="selected">两者都可使用</option>
          {else}
            <option value="1" >仅限外卖使用</option>
            <option value="2">仅限店内使用</option>
            <option value="3">两者都可使用</option>
          {/if}
        </select>
      </div>
    </div>
  <div class="form-group">
    <label for="inputEmail3" class="col-sm-2 control-label">使用说明</label>
    <div class="col-sm-10">
      <input type="text"  name="instruction" value="{$list['instruction']}" class="form-control" id="inputEmail3" placeholder="请填写使用说明">
    </div>
  </div>
   <input type="hidden" name="id" value="{$list['id']}"/>
  <input type="hidden" name="token" value="{$_W['token']}"/>
  <div class="form-group" style="margin-top: 20px;">
      <input type="submit" name="submit" value="提交" class="btn col-lg-3" style="color: white;background-color: #44ABF7;"/>
  </div>
</form>
</div>
<script type="text/javascript">
    $(function(){
        $("#frame-4").show();
        $("#yframe-4").addClass("wyactive");
    })
</script>